package com.dg.service.impl;

import com.dg.dao.RoleUserMapper;
import com.dg.exception.ParamException;
import com.dg.service.RoleUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleUserServiceImpl implements RoleUserService {

    @Autowired
    private RoleUserMapper roleUserMapper;

    @Override
    public List<Integer> selectUser(Integer roleId) {
        if(roleId == null){
            throw new ParamException("roleId不能为空");
        }
        return roleUserMapper.getUserIdListByRoleId(roleId);
    }

}
